package com.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.ChongdianzhuangDao;
import com.dao.ChongdianzhuangOrderDao;
import com.entity.ChongdianzhuangEntity;
import com.entity.ChongdianzhuangOrderEntity;
import com.service.ChongdianzhuangOrderService;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("chongdianzhuangOrderService")
public class ChongdianzhuangOrderServiceImpl extends ServiceImpl<ChongdianzhuangOrderDao, ChongdianzhuangOrderEntity> implements ChongdianzhuangOrderService {


    @Autowired
    private ChongdianzhuangDao chongdianzhuangDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<ChongdianzhuangOrderEntity> page = this.selectPage(
                new Query<ChongdianzhuangOrderEntity>(params).getPage(),
                new EntityWrapper<ChongdianzhuangOrderEntity>()
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<ChongdianzhuangOrderEntity> wrapper) {
        Page<ChongdianzhuangOrderEntity> page =new Query<ChongdianzhuangOrderEntity>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }


    @Override
    public List<ChongdianzhuangOrderEntity> selectListVO(Wrapper<ChongdianzhuangOrderEntity> wrapper) {
        return baseMapper.selectListVO(wrapper);
    }

    @Override
    public ChongdianzhuangOrderEntity selectVO(Wrapper<ChongdianzhuangOrderEntity> wrapper) {
        return baseMapper.selectVO(wrapper);
    }

    @Override
    public List<ChongdianzhuangOrderEntity> selectListView(Wrapper<ChongdianzhuangOrderEntity> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public ChongdianzhuangOrderEntity selectView(Wrapper<ChongdianzhuangOrderEntity> wrapper) {
        return baseMapper.selectView(wrapper);
    }
}
